<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>编辑内容</title>
	<hdjs />
	<script type="text/javascript">
		$(function(){
			$('form').validate({
				{$validate}	
			})
		})
	</script>
	<js file='__PUBLIC__/Js/mod.article.js' />
	<css file="__PUBLIC__/Css/mod.welcome.css" />
	<css file="__PUBLIC__/Css/mod.base.css" />
</head>
<body>
	<form action="" method="post" enctype='multipart/form-data'>
		<div class="wrap">
			<div class="title-header"><span>{$cname}</span> 编辑内容</div>
			<div class="menu_list">
				<ul>
					<if condition="$catType neq 4">
					<li>
						<a href="{:U('Article/index',array('cid'=>$field['category_cid']))}" >
							内容列表
						</a>
					</li>
					</if>
					<li>
						<a href="javascript:;" class="action">
						编辑内容
						</a>
					</li>
				</ul>
			</div>

			<div class="tab">
				<ul class="tab_menu">
					<li lab='base'><a href="#">基本配置</a></li>
					<li lab='pic'><a href="#">图集上传</a></li>
				</ul>
				<div class="tab_content">
					<div id='base'>

			<table class=' hd-form table2'>
				<tbody>
					
					<tr>
						<td class="w100">栏目分类</td>
						<td>
							<if condition="$catType neq 4">
							<select name="category_cid" >
								<option value="0">请选择分类</option>
								<option <if condition="$topid eq $field['category_cid']">selected='selected'</if> value="{$topid}">{$topname}</option>
								<foreach name='category' item='v'>
									<option <if condition="$v['cid'] eq $field['category_cid']">selected='selected'</if> {$v.disabled} value="{$v.cid}">---{$v._html}{$v.cname}</option>
								</foreach>
							</select>
							<else/>
							{$cname}
							<input type="hidden" name="category_cid" value="{$cid}" />
							</if>
						</td>
					</tr>
					<tr>
						<td class="w100">标题</td>
						<td>
							<input type="text" name="article_title"  class='w350 title' value="{$field.article_title}"  />
						</td>
					</tr>
					
				
					<tr>
						<td>关键字</td>
						<td>
							<textarea name="keywords" class='w500 h100'>{$field.keywords}</textarea>
						</td>
					</tr>
					
					<tr>
						<td>描述</td>
						<td>
							<textarea name="description" class='w500 h100'>{$field.description}</textarea>
						</td>
					</tr>
					
					<tr>
						<td>排序</td>
						<td>
							<input name="sort" type="text" class='w200'  value="{$field.sort}" />
						</td>
					</tr>
					<tr>
						<td>次数</td>
						<td>
							<input name="click" type="text" class='w200'  value="{$field.click}" />
						</td>
					</tr>
					<tr>
						<td>发布时间</td>
						<td>
							<input name="addtime" id='addtime' type="text" class='w200' value="{$field.addtime|date='Y-m-d',###}"/>
							<script>
								$('#addtime').calendar({
									format : 'yyyy-MM-dd'
								});
							</script>
						</td>
					</tr>
					<tr>
						<td>审核</td>
						<td>
							<label >
								<input <if condition="$field['verifystate'] eq 1">checked="checked"</if> name="verifystate" type="radio"  value="1" /> 审核中
							</label>
							<label >
								<input <if condition="$field['verifystate'] eq 2">checked="checked"</if>  name="verifystate" type="radio" value="2" /> 通过
							</label>
						</td>
					</tr>
					<tr>
						<td>属性</td>
						<td>

							<foreach name='flag' item='v'>
							<label >
								<input <if condition="strchr($field['flag'],$v)">checked='checked'</if> name="flag[]" type="checkbox"  value="{$v}" /> {$v}({$key})
							</label>
							</foreach>
							
						</td>
					</tr>
					<tr>
						<td>图片</td>
						<td>
							<input type="file" name='pic'/>
							<br/>
							<img src="{$field.pic}" alt=""  width="100" />
							<if condition='$field["has_pic"]'>
								<a href="javascript:;" onclick="del_attachment(this,'{$field.aid}','pic')">删除</a>
							</if>
						</td>
					</tr>
					<tr >
						<td>文件</td>
						<td>
							<input type="file" name='file'/>
							<br/>
							<if condition ="$field['file']">
								<a href="{$field.downurl}">下载</a>
							</if>
							<if condition='$field["has_file"]'>
								<a href="javascript:;" onclick="del_attachment(this,'{$field.aid}','file')">删除</a>
							</if>
						</td>
					</tr>
				
					<foreach name='extForm' item='v'>
					<tr>
						<td>{$v.title}</td>
						<td>{$v.html}</td>
					</tr>
					</foreach>
					<if condition='$attrForm'>
					<tr>
						<th align='left' colspan='2'>筛选</th>
					</tr>
					<foreach name='attrForm' item='v'>
					<tr>
						<td>{$v.title}</td>
						<td>{$v.html}</td>
					</tr>
					</foreach>
					</if>
				</tbody>
			</table>
			</div>
					<div id='pic'>
						<if condition='!$attrPicCount'>
						<ul class='one_pic'>
							<foreach name='pics' item='p'>
							<li>
								<img src="{$p.big}" alt=""  width="100" />
								<p>{$p.pic_title}</p>
								<span rel="{$p.id}" onclick='del_img(this)'>×</span>
							</li>
							</foreach>
						</ul>
				
						<table cellpadding="0" cellspacing="0" class='table2 hd-form'>
							<tr>
								<td width="20"><span class='hand' onclick='add_pic(this)'>[+]</span></td>
								<td width="50"><input type="file" name="img[]" class="input noborder" /></td>
								<td><input type="text" name="pic_title[]" class="input" /></td>
							</tr>

						</table>
						<else />


								<div class="color">
								
							
									<ul class="color_menu">
										<foreach name='pics' item='attr'>
										<li lab='attr{$attr.attr_value_id}' ><a href="#" >{$attr.attr_value}</a></li>
										</foreach>
									</ul>
									
									<div class="color_content">
										
										<foreach name='pics' item='attr'>
										<div id='attr{$attr.attr_value_id}'>

											<ul class='one_pic'>
												<foreach name='attr.pics' item='p'>
												<li>
													<img src="{$p.big}" alt=""  width="100" />
													<p>{$p.pic_title}</p>
													<span rel="{$p.id}" onclick='del_img(this)'>×</span>
												</li>
												</foreach>
											</ul>
											<table class='table2 hd-form'>
												<tr>
													<td width="20"><span class='hand' onclick='add_pic(this)'>[+]</span></td>
													<td ><input type="file" name="img{$attr.attr_value_id}[]" class="input noborder" /></td>
													<td style='display:none'><input type="text" name="pic_title{$attr.attr_value_id}[]" class="input" /></td>
												</tr>
											</table>
										</div>
										</foreach>
										
									</div>
									<input type='hidden' name='attrPic' value='1' />
							</div>


						</if>
					</div>
				</div>
			</div>
		</div>
	<div class="position-bottom">
		<input type="hidden" name="aid" value="{$field.aid}" />
		<input type="submit" class='hd-success' value="编辑" />
		<input type="button" class="hd-cancel" onclick="location.href='{:U('Article/index',array('cid'=>$field['category_cid']))}'" value="返回"/>	
	</div>
	</form>

</body>
</html>